package com.kk.blog.service;


import com.kk.blog.pojo.Blog;
import com.kk.blog.vo.BlogQuery;
import org.apache.ibatis.javassist.NotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;


import java.util.List;
import java.util.Map;


public interface BlogSrevice {

    //查找博客
    Blog getBlog(Long id);

    Blog getAndConvert (Long id) throws NotFoundException;

    //查询所有博客
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);  //分类博客的查询

    Page<Blog> listBlog(Pageable pageable);

    Page<Blog> listBlog(Long tagId,Pageable pageable);  //标签博客的查询

    Page<Blog> listBlog(String query,Pageable pageable);

    List<Blog> listRecommendBlogTop(Integer size);

    Map<String,List<Blog>> archiveBlog();  //归档按年份查询博客
    Long countBlog();

    //保存博客
    Blog saveBlog(Blog blog);

    //修改博客
    Blog updateBlog(Long id,Blog blog) throws NotFoundException;

    //删除博客
    void deleteBlog(Long id);



}
